<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="tephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
	</head>
	<style>
      #footer{
        border-top: 1px solid red;
      }
	</style>
	<body id="header">
    <header id="header" class="aui-bar aui-bar-nav" id="aui-header">
        <div class="aui-title">贵州国企投资</div>
    </header>
		<!-- <span tapmode onclick="fnOpen()">open()</span>
		<span tapmode onclick="fnClose()">close()</span>
		<span tapmode onclick="fnShow()">show()</span>
		<span tapmode onclick="fnHide()">hide()</span>
		<span tapmode onclick="fnSetCurrentIndex()">setCurrentIndex()</span>
		<span tapmode onclick="fnReloadData()">reloadData()</span>
		<span tapmode onclick="fnAddEventListener()">addEventListener()</span> -->
    <div id="demo">


    </div>


    <footer class="aui-bar aui-bar-tab" id="footer">
      <div class="aui-bar-tab-item aui-active  auilength" tapmode onclick="openFooterFrame(0)">
          <i class="aui-iconfont"><img src=""/></i>
          <div class="aui-bar-tab-label">首页</div>
      </div>
      <div class="aui-bar-tab-item auilength" tapmode onclick="openFooterFrame(1)">
          <i class="aui-iconfont"></i>
          <div class="aui-bar-tab-label">投资理财</div>
      </div>
      <div class="aui-bar-tab-item auilength" tapmode onclick="openFooterFrame(2)">
          <i class="aui-iconfont"></i>
          <div class="aui-bar-tab-label">转让专区</div>
      </div>
      <div class="aui-bar-tab-item auilength" tapmode onclick="openFooterFrame(3)">
          <div class="aui-dot"></div>
          <i class="aui-iconfont"></i>
          <div class="aui-bar-tab-label">我的</div>
      </div>
  </footer>

</footer>

	</body>
  <script src="../script/aui-tab.js" charset="utf-8"></script>
  <script src="../script/api.js" charset="utf-8"></script>
	<script type="text/javascript">

		apiready = function() {
			//适配iOS 7+，Android 4.4+状态栏

			// var header = $api.byId('header');

	// alert( $api.offset(header2).h)

      	api.parseTapmode();
				var header =$api.byId('header');
		// var header1=   $api.byId('header1');
		 $api.fixStatusBar(header);
		// var headerH1 = $api.offset(header1).h;
		var headerH = $api.offset(header).h;
		var footer =   $api.byId('footer');
		var footerH = $api.offset(footer).h;
		var auilength = $api.domAll(footer, '.auilength');
   		api.openFrameGroup ({
   		    name: 'mainFrameGroup',
   		    background: '#fff',
   		    scrollEnabled: false,
   		    rect: {
   		         x: 0,
   		         y: headerH,
   		         w: 'auto',
   		         h: api.winHeight - footerH - headerH
   		    },
   		    index: 0,
   		    frames: [{
   		        name: 'home',
   		        url: 'home.html',
   		        bgColor: '#fff'
   		    },{
   		        name: 'star',
   		        url: 'star.html',
   		        bgColor: '#fff'
   		    },{
   		        name: 'cart',
   		        url: 'cart.html',
   		        bgColor: '#fff'
   		    },{
   		        name: 'my',
   		        url: 'my.html',
   		        bgColor: '#fff'
   		    }]
   		}, function(ret, err){

	   		 for (var i = 0; i < auilength.length; i++) {
	   		 	if (ret.index ==  i ) {
	   		 		$api.addCls(auilength[i], 'aui-active');
	   		 	}else{
	   		 		$api.removeCls(auilength[i], 'aui-active');
	   		 	}
	   		 }
				 $api.toast('加载中','请稍候...',500);

   		});



};



     function openFooterFrame(_index){
     	api.setFrameGroupIndex({
     	    name: 'mainFrameGroup',
     	    index: _index,
     	    scroll: true
     	});

     }


</script>
</html>
